package com.bee.plus.ai;

import com.bee.plus.vo.ModelType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;

@Component
public class AiMachineSelector {

    @Autowired
    @Qualifier("aliyunAi")
    private BaseAiService aliyunAiService;

    @Autowired
    @Qualifier("baiduAi")
    private BaseAiService baiduAiService;


    @Autowired
    @Qualifier("kimiAi")
    private BaseAiService kimiAiService;


    public static Map<ModelType,BaseAiService> modelTypeBaseAiServiceMap=new HashMap<ModelType,BaseAiService>();


    @PostConstruct
    private void load(){
        modelTypeBaseAiServiceMap.put(ModelType.Ali,aliyunAiService);
        modelTypeBaseAiServiceMap.put(ModelType.Baidu,baiduAiService);
        modelTypeBaseAiServiceMap.put(ModelType.Kimi,kimiAiService);
    }

    public BaseAiService getAiService(ModelType modelType){
        return modelTypeBaseAiServiceMap.get(modelType);
    }
}



